home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD School House 9
/
CD School House 9.0 - Wayzata Technology (1994).iso
/
pc
/
dos
/
math
/
eebond
/
sdfcvt.exe
/
SDF.DOC
< prev
next >
Wrap
Text File
|
1993-04-08
|
7KB
|
182 lines
SDF
(C) Copyright 1991-1993 by Alan J. Avery All rights reserved
Purpose: Converts delimited ASCII files to System Data Format,
to dBase 3+ format, to delimited format or to Paradox 3.5
or Paradox 4.0 format without requiring any programming
by a user.
Developed by Alan J. Avery
Elvish Consulting
1408 Noble Avenue
Springfield, IL 62704-3450
(217) 698-8600
If you find SDF to be of value to you, please contribute to
its development with a contribution ($20 suggested).
DISCLAIMER
The Author specifically disclaims all other warranties, expressed
or implied, including but not limited to, implied warranties of
merchantability and fitness for a particular purpose with respect to
defects in the diskette and documentation, and the program license
granted herein. In particular, and without limiting operation of the
program license with respect to any particular application, use, or
purpose, in no event shall the Author be liable for any loss of profit
or any other commercial damage, including but not limited to special,
incidental, consequential or other damages. Your use of this program
constitutes acceptance of these terms.
Table Of Contents
Introduction to SDF................................1
How to Start SDF...................................1
Commands That Control SDF Behavior.................2
How SDF Works......................................3
Errors Reported....................................3
See the COMMANDS.SDF file for a listing and brief
description of the commands that can be used.
Page 1
Introduction to SDF
Many database programs can 'export' their data to an ASCII file where each
field is (usually) surrounded by quotes and separated from the following
field by a comma. Two such records might look like this:
"Mr.","Alan","J.","Avery","Elvish Consulting","1408 Noble Avenue","","Springfield","IL","62704-3450","(217) 698-8600","USA",""
"","","","","Elvish Consulting","1408 Noble Avenue","","Springfield","IL","62704-3450","(217) 698-8600","USA",""
Importing a file of such records into another program can frequently be
done, but problems can arise. For example, the user attempting to bring
the file into a spreadsheet will be frustrated if one or more lines of the
file exceeds 240 characters in length. Also, how does the user import the
file into a database if the order of the fields in the ASCII file does not
match the order of the database, or if the lengths of the database fields
are too short for the ASCII file?
These are just a few problems that arise when importing ASCII files.
However, they are part of a much larger issue: how can the user exert
control over how the ASCII file is imported? For example, the user might
want to import only those records where field 3 has the string "Sale" in
it. Or, the user might want to import only specific fields, and these
might need to be rearranged to fit the need at hand.
There are many other control points that users may need to exercise.
However, without programming skills, users are at a disadvantage.
SDF is designed to give the user control over delimited ASCII files.
With it, users can specify what fields to keep, which ones to toss,
and a host of other options. SDF can convert files of ANY length, allows
the user to specify how many fields may exist per line (the default is 500
fields per line), can convert fields to UPPER, lower or Proper case, can
left-justify or right-justify fields, and can search for text in a field
(optionally replacing it with other text). It can omit any fields from
the file, and adjust the lengths of others so that they are padded or
truncated to the desired length. It can create a System Data Format file
(all records of identical length, and each record ends with a carriage
return/line feed), a dBase III type database file, a Paradox 3.5 or
Paradox 4.0 database file (with primary and secondary indexes, if desired),
or another delimited ASCII file, which can then be imported.
How to Start SDF
Here's an example. Suppose you type this from the command line:
SDF PROCESS.SDF
The file called PROCESS.SDF contains commands that control the operation
of SDF. For example, it specifies the file to convert, the file to create,
the fields to be converted, the order of the fields, etc.
Page 2
Commands That Control SDF Behavior
Suppose you want to convert INPUT.PRN to an SDF file. In addition, you
want only fields 2, 1, 12, 11, 13 and 19 to be converted, and you want the
fields rearranged in the output file to be in this order. Finally, suppose
you want the fields left-justified, with maximum lengths of 60, 50, 23, 50,
7 and 80 assigned to them. Here's how you would specify the PROCESS.SDF
file to handle this:
Reorder
Surrounded By "
Delimited By ,
Input File INPUT.PRN
Output File NEWFILE.TXT
Output Format SDF
Fill With 32
Field Number 2
Field Length 60
Justify Left
Field Number 1
Field Length 50
Justify Left
Field Number 12
Field Length 23
Justify Left
Field Number 11
Field Length 50
Justify Left
Field Number 13
Field Length 7
Justify Left
Field Number 19
Field Length 80
Justify Left
There are many more commands that can be applied, and a complete listing
of them, along with a brief description, can be found in the COMMANDS.SDF
file that should have been included with this package.
Page 3
How SDF Works
Step 1: SDF reads the ASCII file to determine how many fields are on each
line and the maximum length needed for each field.
Step 2: SDF reads the ASCII file again and, using the information from the
command file, creates the file desired.
Errors Reported
SDF will report the following conditions as errors:
<name> does not exist. - File named <name> was not found.
Processing stops.
Too many (DDD) fields at
line LLL of <name>. - In file named <name>, line LLL has DDD fields
in it, which exceeds SDF's capacity.
Processing continues.
Line LLL has DDD fields
in it, but the previous
line has PPP fields. - In the file being converted, line LLL does
not have the same number of fields as the
previous line (PPP).
Processing continues.
Not enough memory to satisfy
request for BBBB bytes - There is not enough memory to run SDF.
Processing stops.